package com.rimi.bbs.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author jerry
 * @since 2019-02-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public  class Card implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "card_id",type = IdType.AUTO)
    private Integer cardId;

    private Integer technicalId;

    private Integer userId;

    private Integer cardTypeId;

    private String cardTitle;

    private String cardContent;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime cardCreateTime;

    private Integer cardLookNumber;

    @JsonIgnore
    @TableField(exist = false)
    private User user;

    @JsonIgnore
    @TableField(exist = false)
    private CardType cardType;

    @JsonIgnore
    @TableField(exist = false)
    private CardStatus cardStatus;

    /**
     *  帖子是否已有采纳
     *  1 没有采纳 2 已有采纳
     */
    private Integer CardRepliesStatus;

    /**
     * 回答数
     */
    private Integer cardAnswerNumber;

    /**
     * 1表示否 为加精 2 加精
     */
    private Integer cardEssence;

    /**
     * 1表示否 2置顶
     */
    private Integer cardTop;

    /**
     * 帖子解答状态
     * 1已结 2未结
     */
    private Integer cardUnfinished;

    /**
     * 1正常 2删除
     */
    private Integer cardDelete;


    public Card() {
    }

    public Card(Integer cardId, Integer cardLookNumber) {
        this.cardId = cardId;
        this.cardLookNumber = cardLookNumber;
    }


}
